#ifndef TREE_H_INCLUDED
#define TREE_H_INCLUDED
#include <iostream>
#include <cstddef>
using namespace std;

struct TreeNode {
	TreeNode() : parent(NULL), lc(NULL), rc(NULL), value(0) {}
	TreeNode(int value) : parent(NULL), lc(NULL), rc(NULL), value(value) {}
	TreeNode* parent;
	TreeNode* lc;
	TreeNode* rc;
	int value;
};

struct Tree {
	Tree() : root(NULL), _size(1) {}
	void createTree();
	void traTree(TreeNode*);
	int getNum(TreeNode*);
	void delNode(int);
	TreeNode* findNode(TreeNode*, int);
	void reserveLevelOrder(TreeNode*);
	TreeNode* root;
	int _size;
};
#endif // TREE_H_INCLUDED
